package com.fosun.spr.core.message;

/***
 * 
 * @Title: ResultCode.java
 * @Description: 定义操作类
 * @author zhangcheng
 * @version V1.0
 * 
 */
public enum ResultCode implements IResultMessage {
	
	NEEDLOGIN_ERROR("10000", "需要登录权限，请登录!"),
	SPR10000("SPR10000", "需要登录权限，请登录!"),
	
	ILLEGAL_REQUEST_ERROR("10001", "非法请求"),
	DBROW_NOTEXISTS_ERROR("10002", "记录不存在"),

	SUCCESS("0", "请求成功"),

	SERVER_INNER_ERROR("40099", "网络繁忙，请稍后再试"),

	URL_ERROR("40038", "不合法的请求格式"),
	
	ANNOTATION_ERROR("40098", "请严格使用注解"),
	
	PARAMTER_WAY_ERROR("40034", "不合法的请求方式"),

	PARAMTER_ERROR("40035", "不合法的参数"),
	
	SP_MODEL_TYPE_ERROR("40088", "sp对象未继承基类"),

	DB_INSERT_ERROR("420001", "数据保存失败"),

	DB_UPDATE_ERROR("420002", "数据更新失败"),

	DB_DELETE_ERROR("420003", "数据删除失败"),

	DB_SELECT_ERROR("420004", "数据查询失败"),
	
	SR_MODEL_ERROR_NULL("420005","Service 返回Sr为空")

	;

	/** 返回码描述 **/
	private final String code;
	/** 返回码描述 **/
	private final String message;

	/**
	 * 构造函数
	 * 
	 * @param message
	 *            返回码描述
	 */
	private ResultCode(String code, String message) {
		this.code = code;
		this.message = message;
	}

	/** {@inheritDoc} **/
	public String getCode() {
		return code;
	}

	/** {@inheritDoc} **/
	public String getMessage() {
		return message;
	}
}
